/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 */
package com.jeesite.modules.vehicle.web;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.idgen.IdGen;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.general.utils.CosApiUtils;
import com.jeesite.modules.sys.entity.DictData;
import com.jeesite.modules.sys.utils.DictUtils;
import com.jeesite.modules.vehicle.entity.BrandApi;
import com.jeesite.modules.vehicle.entity.CarApi;
import com.jeesite.modules.vehicle.service.BrandApiService;
import com.jeesite.modules.vehicle.service.CarApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 测试数据Controller
 * @author ThinkGem
 * @version 2018-04-22
 */
@Controller
@RequestMapping(value = "${adminPath}/vehicle/")
public class BrandApiController extends BaseController {

	@Autowired
	private BrandApiService brandApiService;

	/**
	 * 查询车品牌列表
	 * */
	@RequestMapping(value = "findBrandList")
	@ResponseBody
	public String findBrandList(BrandApi brandApi){
		Map map = brandApiService.findBrandList(brandApi);
		return renderResult(Global.TRUE, text("获取成功！"), map);
	}

	/**
	 * 首页查询车品牌
	 * */
	@RequestMapping(value = "findBrandLimit")
	@ResponseBody
	public String findBrandLimit(BrandApi brandApi){
		List<BrandApi> list = brandApiService.findBrandLimit(brandApi);
		return renderResult(Global.TRUE, text("获取成功！"), list);
	}
}